﻿using System;
using System.Windows.Controls;

namespace Red.Controls.ValidationRules
{
    public class IsNotEmpty : ValidationRule
    {
        public override ValidationResult Validate( object value, System.Globalization.CultureInfo cultureInfo )
        {
            string valueStr = (string)value;

            if ( String.IsNullOrEmpty( valueStr ) )
            {
                return new ValidationResult( false, "Field may not be empty" );
            }

            return new ValidationResult( true, null );
        }
    }
}
